package n2192;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	
	static int f[][]=new int[205][205];
	
	static String s1,s2,s3;
	static void init(int a,int b)
	{
		for(int i=0;i<=a;i++)
			for(int j=0;j<=b;j++)
				f[i][j]=-1;
	}
	static int solve(int a,int b)
	{//记忆化搜索
		if(a<0||b<0)return 0;
		if(a==0&&b==0)
		{
			return 1;
		}
		
		if(f[a][b]!=-1)return f[a][b];
		
		int result=0;
		
		if(a>0&&s3.charAt(a+b-1)==s1.charAt(a-1))
		{
			result=solve(a-1,b);
		}
		if(result!=1&&b>0&&s3.charAt(a+b-1)==s2.charAt(b-1))
		{
			result=solve(a,b-1);
		}
		f[a][b]=result;
		return f[a][b];
	}
	
	static int solve2(int a,int b)
	{//动态规划
		//初始化
		for(int i=0;i<=a;i++)
			for(int j=0;j<=b;j++)
				f[i][j]=0;
		f[0][0]=1;
		for(int i=1;i<=a;i++){
			if(f[i-1][0]==1&&s1.charAt(i-1)==s3.charAt(i-1))
			{
				f[i][0]=1;
			}
		}
		for(int i=1;i<=b;i++)
		{
			if(f[0][i-1]==1&&s2.charAt(i-1)==s3.charAt(i-1))
			{
				f[0][i]=1;
			}
		}
		
		for(int i=1;i<=a;i++)
			for(int j=1;j<=b;j++)
			{
				if(f[i-1][j]==1&&s1.charAt(i-1)==s3.charAt(i+j-1))
				{
					f[i][j]=1;
				}
				if(f[i][j]==0&&f[i][j-1]==1&&s2.charAt(j-1)==s3.charAt(i+j-1))
				{
					f[i][j]=1;
				}
			}
		
//		for(int i=0;i<=a;i++)
//			{
//				for(int j=0;j<=b;j++)
//				{
//					System.out.print(f[i][j]+" ");
//				}
//				System.out.println();
//			}
				
		return f[a][b];
	}
	
	
	
	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {


		BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
		int t=Integer.parseInt(bf.readLine());
		for(int i=0;i<t;i++)
		{
			StringTokenizer st=new StringTokenizer(bf.readLine());
			s1=st.nextToken();
			s2=st.nextToken();
			s3=st.nextToken();
			if(s3.length()!=s1.length()+s2.length())
			{
				System.out.println("Data set "+(i+1)+": no");
			}else {
				init(s1.length(), s2.length());
				if(solve(s1.length(),s2.length())==1)
				{
					System.out.println("Data set "+(i+1)+": yes");
				}else {
					System.out.println("Data set "+(i+1)+": no");
				}
			}
		}
		
	}

}
